using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace KLib.Particles
{

    #region VertexParticle
    public struct VertexParticle
    {
        public Vector3 Position;
        public Color Color;
        public Vector4 Data;

        public VertexParticle(Vector3 position, Color color)
        {
            this.Position = position;
            this.Color = color;
            this.Data = Vector4.Zero;
        }

        public static readonly VertexElement[] VertexElements = new VertexElement[]
                {
                    new VertexElement(0,0,VertexElementFormat.Vector3,VertexElementMethod.Default,VertexElementUsage.Position,0),
                    new VertexElement(0,sizeof(float)*3,VertexElementFormat.Color,VertexElementMethod.Default,VertexElementUsage.Color,0),
                    new VertexElement(0,sizeof(float)*7,VertexElementFormat.Vector4, VertexElementMethod.Default,VertexElementUsage.TextureCoordinate,0)
                };

        public static int SizeInBytes = sizeof(float) * 13;

        public static bool operator !=(VertexParticle left, VertexParticle right)
        {
            return left.GetHashCode() != right.GetHashCode();
        }

        public static bool operator ==(VertexParticle left, VertexParticle right)
        {
            return left.GetHashCode() == left.GetHashCode();
        }

        public override bool Equals(Object obj)
        {
            return this == (VertexParticle)(obj);
        }

        public override int GetHashCode()
        {
            return Position.GetHashCode() | Color.GetHashCode() | Data.GetHashCode();
        }

        public override string ToString()
        {
            return Position.ToString();
        }
    }
    #endregion

    class Particle
    {
        #region Fields

        private float alpha;
        private float life;
        private Vector3 position;
        private Vector3 velocity;
        private Vector3 rotation;

        #endregion

        #region Properties

        #endregion

        #region Initialization
        public Particle() { }
        public Particle(EmitterSettings settings)
        {

        }
        #endregion

        #region Methods

        #endregion
    }
}
